'use strict'

import HybridJS from '../core/core'

const $ = HybridJS

/**
 *
 * @returns true false
 */
function isLogin() {
    return $.callNativeSync("account","isLogin")
}

/**
 *
 * @returns {"token":""}
 */
function info() {
    return $.callNativeSync("account","info")
}

/**
 *
 * @param function(info){}
 */
function login(fn) {
    $.callNative("account","login",{callback:fn})
}

/**
 *
 * @param fn
 */
function logout(fn) {
    $.callNative("account","logout",{callback:fn})
}

export default {
    isLogin,
    info,
    login,
    logout
}